package ai.people.netmon.framework.exception.enums;

/**
 * * 30???? -- 权限相关异常
 * <p>
 * 身份验证异常枚举
 *
 * @author yuanqinglong
 * @date 2022/2/15 17:16
 */
public enum AuthExceptionEnum implements ExceptionEnum {

    AUTHENTICATION_FAILED(false, 300000, "认证失败"),
    UNAUTHORIZED_ACCESS(false, 300001, "非法访问"),
    AUTH_ACCOUNT_IP_ERROR(false, 300002, "您的IP没有权限访问，请联系管理员！"),
    INSUFFICIENT_PERMISSIONS(false, 300003, "权限不足！"),
    AUTH_LOGIN_ERROR(false, 300004, "登陆过程出现异常请尝试重新操作！"),
    INVALID_TOKEN(false, 300005, "无效的Token！"),
    INTERNAL_SERVICE_EXCEPTION(false, 300006, "内部服务异常！"),
    AUTH_ACCOUNT_ERROR(false, 300007, "用户名或密码错误！"),
    INVALID_CREDENTIALS(false, 300008, "无效的凭证！"),
    AUTH_PWD_NOT_EMPTY(false, 300009, "密码不能为空！"),
    AUTH_NO_LOGIN(false, 300010, "此操作需要登陆系统！"),
    AUTH_PWD_ERROR(false, 300011, "输入密码有误！"),
    AUTH_ACCOUNT_LOCKED(false, 300012, "账号被锁定，请联系管理员！"),
    AUTH_ACCOUNT_TIME_EXPIRY(false, 300013, "您的账号服务已到期，请联系管理员！"),
    UNAUTHENTICATED(false,300014,"此操作需要登陆系统！"),
    ACCESS_TOKEN_INVALID(false, 300015, "Token无效，请重新获取！"),
    REFRESH_TOKEN_INVALID(false, 300016, "refresh_token无效，请重新获取！"),
    UNABLE_TO_VERIFY_IDENTITY(false, 300017, "身份验证未通过"),
    COOKIE_MISSING_TOKEN(false, 300018, "cookie缺少令牌"),
    HEADER_TOKEN_AND_COOKIE_TOKENS_ARE_INCONSISTENT(false, 300018, "header令牌与cookie令牌不一致"),
    TOKEN_FORMAT_ERROR(false, 300019, "Token格式错误"),
    UNAUTHORIZED_GRANT_TYPE(false, 300020, "未经授权的授权类型")
    ;


    /**
     * 状态
     */
    final boolean status;
    /**
     * 代码
     */
    final int code;
    /**
     * 消息
     */
    final String message;

    AuthExceptionEnum(boolean status, int code, String message) {
        this.status = status;
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public boolean getStatus() {
        return status;
    }
}
